package com.yzg.sign.project.domain;


import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Proxy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;


@Entity
@Data
@Proxy(lazy = false)
@Table(name = "c_customer")
@EntityListeners(AuditingEntityListener.class)
public class Customer implements Serializable
{


    @Id
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    @Column(columnDefinition = "VARCHAR(50) COMMENT '主键ID'")
    private String id;

    @ApiModelProperty("用户名")
    @Column(columnDefinition = "VARCHAR(50) COMMENT '用户名'")
    private String userName;

    @ApiModelProperty("头像")
    @Column(columnDefinition = "VARCHAR(500) COMMENT '头像'")
    private String avatarUrl;

    @ApiModelProperty("性别")
    @Column(columnDefinition = "VARCHAR(50) COMMENT '性别'")
    private String gender;

    @ApiModelProperty("城市")
    @Column(columnDefinition = "VARCHAR(50) COMMENT '城市'")
    private String city;

    @ApiModelProperty("省份")
    @Column(columnDefinition = "VARCHAR(50) COMMENT '省份'")
    private String province;

    @ApiModelProperty("国家")
    @Column(columnDefinition = "VARCHAR(50) COMMENT '国家'")
    private String country;

    @ApiModelProperty("openId")
    @Column(columnDefinition = "VARCHAR(50) COMMENT 'openId'")
    private String openId;



    @ApiModelProperty("sessionKey")
    @Column(columnDefinition = "VARCHAR(50) COMMENT 'sessionKey'")
    private String sessionKey;

    @ApiModelProperty("是否授权")
    @Column(columnDefinition = "INTEGER COMMENT 'status'")
    private Integer status=0;


    @CreatedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(columnDefinition = "DATETIME COMMENT '创建时间'")
    private Date createTime;

    @LastModifiedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(columnDefinition = "DATETIME COMMENT '修改时间'")
    private Date updateTime;


    @Version
    @ApiModelProperty(value = "版本号")
    @Column(columnDefinition = "INTEGER(10) COMMENT '版本号'")
    private int versionId;



}
